import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
    {
        path: "/",
        name: "login",
        component: () => import("../views/login.vue"),
    },
    {
        path: "/main",
        name: "main",
        component: () => import("../views/main.vue"),
        redirect: "/service/home",
        children: [
            {
                path: "/service/home",
                name: "home",
                component: () => import("../views/home.vue"),
            },
            {
                path: "/service/dispatcher",
                name: "instance",
                component: () => import("../views/cluster/dispatcher.vue"),
            },
            {
                path: "/service/sipaccount",
                name: "mirror",
                component: () => import("../views/cluster/sipaccount.vue"),
            },
            {
                path: "/service/whitelist",
                name: "host",
                component: () => import("../views/cluster/whitelist.vue"),
            },
            {
                path: "/service/command",
                name: "command",
                component: () => import("../views/cluster/command.vue"),
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
})

export default router
